The present disclosure relates to methods and apparatus for processing pixel depth information and, in particular, to eliminating pixel pipeline delays due to processing depth or Z data.
In conventional graphics processing systems, in order to save processing resources, pixel depth or Z data may be tested early in order to determine whether or not the pixel should be rendered in a particular frame (termed “early Z”). There are situations, however, where early testing of the Z depth cannot be performed such as, when the outcome or result of a particular processing of the pixel data is required before a determination of whether or not a pixel having a particular Z depth component should be written to a Z frame buffer. Particular examples of such processing include, but are not limited to, alpha testing and pixel kill conditions. Pixel kill conditions can occur, for example, to provide special visual effects. A pixel can be killed in a pipeline when the pixel should not be present in the rendered scene. Such a case might be encountered in a scene with trees, for example, in which pixels associated with leaves should be rendered, but pixels associated with the space between leaves should not be rendered, leaving the background to show through. Alpha testing is the process by which a pixel an be killed if a pixel value is beyond a threshold.
As a result of situations where early Z processing cannot be carried out, the Z processing stage (i.e., logic) becomes modal where the stage conditionally decides whether to perform early Z or late Z testing. Late Z testing occurs after a pixel has been produced by the pipeline. In conventional graphics processing systems, however, since there is typically only one set of Z processing logic (i.e. one Z processing stage), conventional systems must flush the pipeline prior to switching from late Z to early Z testing with a resultant loss in performance due to having to wait for all of the late Z pixels to be processed prior to the Z processing stage entering early Z processing mode. Also early Z processing typically needs to maintain pixel processing ordering rules and thus might need to use the Z results from the late Z pixels if both are for the same display screen position.
Accordingly, a need exists for a method and apparatus that may process early and late Z depth values at the same time in order to avoid having to drain the pipeline.